package com.example.demo.pojos;

import javax.persistence.*;
import java.sql.Timestamp;
import java.util.Objects;

@Entity
public class Complain {
    private String complainTheme;
    private String complainLinkman;
    private String complainPhone;
    private int complainWay;
    private Timestamp complainRegisterDate;
    private Timestamp complainStatrDate;
    private Timestamp complainEndDate;
    private String complainSpendDate;
    private String complainUrgency;
    private String complainState;
    private String complainContent;
    private String complainFeedback;
    private String complainComment;
    private Client kh;
    private User zxr;
    private Complaintype tsfl;
    private Order htdd;


    @Id
    @Column(name = "complain_theme", nullable = false, length = 255)
    public String getComplainTheme() {
        return complainTheme;
    }

    public void setComplainTheme(String complainTheme) {
        this.complainTheme = complainTheme;
    }

    @Basic
    @Column(name = "complain_linkman", nullable = false, length = 20)
    public String getComplainLinkman() {
        return complainLinkman;
    }

    public void setComplainLinkman(String complainLinkman) {
        this.complainLinkman = complainLinkman;
    }

    @Basic
    @Column(name = "complain_phone", nullable = false, length = 20)
    public String getComplainPhone() {
        return complainPhone;
    }

    public void setComplainPhone(String complainPhone) {
        this.complainPhone = complainPhone;
    }

    @Basic
    @Column(name = "complain_way", nullable = false)
    public int getComplainWay() {
        return complainWay;
    }

    public void setComplainWay(int complainWay) {
        this.complainWay = complainWay;
    }

    @Basic
    @Column(name = "complain_registerDate", nullable = false)
    public Timestamp getComplainRegisterDate() {
        return complainRegisterDate;
    }

    public void setComplainRegisterDate(Timestamp complainRegisterDate) {
        this.complainRegisterDate = complainRegisterDate;
    }

    @Basic
    @Column(name = "complain_statrDate", nullable = false)
    public Timestamp getComplainStatrDate() {
        return complainStatrDate;
    }

    public void setComplainStatrDate(Timestamp complainStatrDate) {
        this.complainStatrDate = complainStatrDate;
    }

    @Basic
    @Column(name = "complain_endDate", nullable = true)
    public Timestamp getComplainEndDate() {
        return complainEndDate;
    }

    public void setComplainEndDate(Timestamp complainEndDate) {
        this.complainEndDate = complainEndDate;
    }

    @Basic
    @Column(name = "complain_spendDate", nullable = true, length = 20)
    public String getComplainSpendDate() {
        return complainSpendDate;
    }

    public void setComplainSpendDate(String complainSpendDate) {
        this.complainSpendDate = complainSpendDate;
    }

    @Basic
    @Column(name = "complain_urgency", nullable = true, length = 10)
    public String getComplainUrgency() {
        return complainUrgency;
    }

    public void setComplainUrgency(String complainUrgency) {
        this.complainUrgency = complainUrgency;
    }

    @Basic
    @Column(name = "complain_state", nullable = true, length = 100)
    public String getComplainState() {
        return complainState;
    }

    public void setComplainState(String complainState) {
        this.complainState = complainState;
    }

    @Basic
    @Column(name = "complain_content", nullable = true, length = 255)
    public String getComplainContent() {
        return complainContent;
    }

    public void setComplainContent(String complainContent) {
        this.complainContent = complainContent;
    }

    @Basic
    @Column(name = "complain_feedback", nullable = true, length = 255)
    public String getComplainFeedback() {
        return complainFeedback;
    }

    public void setComplainFeedback(String complainFeedback) {
        this.complainFeedback = complainFeedback;
    }

    @Basic
    @Column(name = "complain_comment", nullable = true, length = 255)
    public String getComplainComment() {
        return complainComment;
    }

    public void setComplainComment(String complainComment) {
        this.complainComment = complainComment;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Complain complain = (Complain) o;
        return complainWay == complain.complainWay &&
                Objects.equals(complainTheme, complain.complainTheme) &&
                Objects.equals(complainLinkman, complain.complainLinkman) &&
                Objects.equals(complainPhone, complain.complainPhone) &&
                Objects.equals(complainRegisterDate, complain.complainRegisterDate) &&
                Objects.equals(complainStatrDate, complain.complainStatrDate) &&
                Objects.equals(complainEndDate, complain.complainEndDate) &&
                Objects.equals(complainSpendDate, complain.complainSpendDate) &&
                Objects.equals(complainUrgency, complain.complainUrgency) &&
                Objects.equals(complainState, complain.complainState) &&
                Objects.equals(complainContent, complain.complainContent) &&
                Objects.equals(complainFeedback, complain.complainFeedback) &&
                Objects.equals(complainComment, complain.complainComment);
    }

    @Override
    public int hashCode() {
        return Objects.hash(complainTheme, complainLinkman, complainPhone, complainWay, complainRegisterDate, complainStatrDate, complainEndDate, complainSpendDate, complainUrgency, complainState, complainContent, complainFeedback, complainComment);
    }

    @ManyToOne
    @JoinColumn(name = "complain_clientID", referencedColumnName = "client_id", nullable = false)
    public Client getKh() {
        return kh;
    }

    public void setKh(Client kh) {
        this.kh = kh;
    }

    @ManyToOne
    @JoinColumn(name = "complain_doPeopleID", referencedColumnName = "uid")
    public User getZxr() {
        return zxr;
    }

    public void setZxr(User zxr) {
        this.zxr = zxr;
    }

    @ManyToOne
    @JoinColumn(name = "complain_typeID", referencedColumnName = "ct_ID", nullable = false)
    public Complaintype getTsfl() {
        return tsfl;
    }

    public void setTsfl(Complaintype tsfl) {
        this.tsfl = tsfl;
    }

    @OneToOne
    @JoinColumn(name = "complain_htddh", referencedColumnName = "order_id")
    public Order getHtdd() {
        return htdd;
    }

    public void setHtdd(Order htdd) {
        this.htdd = htdd;
    }
}
